package com.qingcloud.base.api.remote.uaa.factory;
import com.qingcloud.base.api.remote.uaa.UaaApi;
import com.qingcloud.base.api.remote.uaa.fallback.UaaApiFallback;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class UaaApiFallbackFactory implements FallbackFactory<UaaApi> {
    @Override
    public UaaApi create(Throwable throwable) {
        UaaApiFallback fallback = new UaaApiFallback();
        fallback.setCause(throwable);
        return fallback;
    }
}
